setExtensionManager(extensionManager);
export class Extension extends ExtensionBase {
+ static lookupByUUID(uuid) {
+ return extensionManager.lookup(uuid)?.stateObj ?? null;
+ }
+
static defineTranslationFunctions(url) {
const wrapper = new GettextWrapper(this, url);
return wrapper.defineTranslationFunctions();
setExtensionManager(extensionManager);
export class ExtensionPreferences extends ExtensionBase {
+ static lookupByUUID(uuid) {
+ return extensionManager.lookup(uuid)?.stateObj ?? null;
+ }
+
static defineTranslationFunctions(url) {
const wrapper = new GettextWrapper(this, url);
return wrapper.defineTranslationFunctions();
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
+import GObject from 'gi://GObject';
import {bindtextdomain} from 'gettext';
path = GLib.path_get_dirname(path);
const dirName = GLib.path_get_basename(path);
- const extension = _extensionManager.lookup(dirName);
+ const extension = this.lookupByUUID(dirName);
if (extension !== undefined)
- return extension.stateObj;
+ return extension;
} while (path !== '/');
return null;
}
+ /**
+ * Look up an extension by UUID
+ *
+ * @param {string} _uuid
+ */
+ static lookupByUUID(_uuid) {
+ throw new GObject.NotImplementedError();
+ }
+
/**
* @param {object} metadata - metadata passed in when loading the extension
*/